<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>新建计划</title>
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>/css/popcalendar.css">
<LINK href="<%=basePath%>/css/top.css" type=text/css rel=stylesheet>
<LINK href="<%=basePath%>/css/main.css" type="text/css" rel="stylesheet">
<SCRIPT src="<%=basePath%>/js/My97DatePicker/WdatePicker.js"></SCRIPT>
<script src="<%=basePath%>/js/function.js"></script>
<script Language="JavaScript">		
function CheckForm()
		{
			if (document.Form1.txtName.value=="")
			{
				alert("工作计划的名称不能为空！");
				document.Form1.txtName.focus();
				return (false);
			}
			
			if (document.Form1.ddlTypeId.value=="")
			{
				alert("请选择工作计划的类型！");
				return (false);
			}		
		
			var oEditor = FCKeditorAPI.GetInstance('txtContent');
			if(oEditor.GetHTML() == "")  
			{
				alert("工作计划的内容为空！");
				return (false);
			}
			if(!checkIsDate(document.Form1.txtBeginDate.value))
			{
				alert("生效日期不正确！");
				document.Form1.txtBeginDate.focus();
				return (false);
			}
			   
			if(!checkIsDate(document.Form1.txtEndDate.value))
			{
				alert("终止日期不正确！");
				document.Form1.txtEndDate.focus();
				return (false);
			}
			
			if ((document.Form1.ToId.value=="") && (document.Form1.ParticipatorId.value==""))
			{
				alert("请指定发布范围或参与人不能同时为空！");
				return (false);
			} 
			
			if (document.Form1.ddlTypeId.value=="")
			{
				alert("计划类型不能为空！");
				document.Form1.ddlTypeId.focus();
				return (false);
			}			
			return true;
		}

		function CheckFile()
		{
			if (document.Form1.fileAttach.value=="")
			{
				alert("请选择附件！");
				return (false);
			}   
			return true;	
		}
			
		</script>
</HEAD>
<body topmargin="5">
<form name="Form1" method="post" action="PlanServlet" id="Form1">
<div><input type="hidden" name="plan" id="__VIEWSTATE" value="add" />
</div>

<div id="pnlMain">
<table border="0" width="90%" cellspacing="0" cellpadding="3"
	class="small">
	<tr>
		<td class="Big"><img
			src="<%=basePath%>/img/office/notify_new.gif" align="absMiddle">
		<span class="big3">新建工作计划</span></td>
	</tr>
</table>
<TABLE class="small" cellSpacing="1" cellPadding="2" width="90%"
	align="center" bgColor="#000000" border="0">
	<TR>
		<TD class="TableData" noWrap width="10%">计划名称：</TD>
		<TD class="TableData"><input name="txtName" type="text"
			id="txtName" class="BigInput" maxlength="200" size="50" /></TD>
	</TR>





	<TR>
		<TD class="TableData" noWrap>开始日期：</TD>
		<TD class="TableData"><input name="txtBeginDate" type="text"
			id="txtBeginDate" class="BigInput" maxlength="10" size="12" value=""
			onclick="WdatePicker()" /></TD>
	</TR>
	<TR>
		<TD class="TableData" noWrap>预计完成日期：</TD>
		<TD class="TableData"><input name="txtEndDate" type="text"
			id="txtEndDate" class="BigInput" maxlength="10" size="12"
			onclick="WdatePicker()" /></TD>
	</TR>
	<TR>
		<TD class="TableData" noWrap>计划类型：</TD>
		<TD class="TableData"><select name="txtType" id="ddlTypeId"
			class="BigSelect">

			<option value="工作计划" selected>工作计划</option>
			<option value="项目计划">项目计划</option>
			<option value="经营计划">经营计划</option>
			<option value="生产计划">生产计划</option>
			<option value="销售计划">销售计划</option>
			<option value="采购计划">采购计划</option>

		</select></TD>
	</TR>

	<TR>
		<TD class="TableData" noWrap>参与人：</TD>
		<TD class="TableData"><textarea name="ParticipatorName"
			id="ParticipatorName" class="BigStatic" rows="2" wrap="yes" cols="45"></textarea>&nbsp;<INPUT
			class="SmallButton" title="添加用户"
			onClick="user_select('ParticipatorId','ParticipatorName');"
			type="button" value="添 加" name="button">&nbsp;<INPUT
			class="SmallButton" title="清空用户"
			onClick="clear_double('ParticipatorId','ParticipatorName');"
			type="button" value="清 空" name="button"><input
			name="ParticipatorId" type="hidden" id="ParticipatorId" /></TD>
	</TR>
	<TR>
		<TD class="TableData" noWrap>负责人：</TD>
		<TD class="TableData"><textarea name="ManagerName"
			id="ManagerName" class="BigStatic" rows="2" wrap="yes" cols="45"></textarea>&nbsp;<INPUT
			class="SmallButton" title="添加用户"
			onClick="user_select('ManagerId','ManagerName');" type="button"
			value="添 加" name="button">&nbsp;<INPUT class="SmallButton"
			title="清空用户" onClick="clear_double('ManagerId','ManagerName');"
			type="button" value="清 空" name="button"><input
			name="ManagerId" type="hidden" id="ManagerId" /></TD>
	</TR>


	<TR>
		<TD class="TableData" noWrap>备注：</TD>
		<TD class="TableData"><textarea name="txtRemark" id="txtRemark"
			class="BigInput" rows="2" cols="45"></textarea></TD>
	</TR>
	<TR>
		<TD class="TableData" noWrap>目前状态：</TD>
		<TD class="TableData"><input value="0" name="RadioGroup"
			type="radio" id="rdoStatus0" onClick="status_change();"
			checked="checked" /><SPAN style="COLOR: red">未开始</SPAN> <input
			value="1" name="RadioGroup" type="radio" id="rdoStatus1"
			onClick="status_change();" /><SPAN style="COLOR: blue">进行中</SPAN> <input
			value="2" name="RadioGroup" type="radio" id="rdoStatus2"
			onClick="status_change();" /><SPAN style="COLOR: green">完成</SPAN></TD>
	</TR>
	<TR>
		<TD class="TableData" noWrap>目前完成百分比：</TD>
		<TD class="TableData"><select name="sltCompletedPercent"
			id="sltCompletedPercent" class="BigSelect"
			onChange="percent_change()">
			<option value="0" selected>0%</option>
			<option value="1">10%</option>
			<option value="2">20%</option>
			<option value="3">30%</option>
			<option value="4">40%</option>
			<option value="5">50%</option>
			<option value="6">60%</option>
			<option value="7">70%</option>
			<option value="8">80%</option>
			<option value="9">90%</option>
			<option value="10">100%</option>
		</select></TD>
	</TR>
	<TR>
		<TD class="TableData" noWrap>提醒：</TD>
		<TD class="TableData"><input id="ckbSms" type="checkbox"
			name="ckbSms" checked="checked" /><label for="ckbSms">使用内部短信提醒员工</label>
		<input id="ckbMobile" type="checkbox" name="ckbMobile" /><label
			for="ckbMobile">使用手机短信提醒员工</label></TD>
	</TR>
	<TR>
		<TD class="TableData" noWrap>计划内容：</TD>
		<TD class="TableData"><textarea name="txtContent" id="txtContent"
			class="BigInput" rows="2" cols="45"></textarea></TD>
	</TR>
	<div id="pnlField"></div>
	<TR class="TableControl" align="center">
		<TD noWrap colSpan="2"><input type="submit" name="btnSubmit"
			value="提交" onClick="return CheckForm();" id="btnSubmit"
			class="BigButton" />&nbsp;&nbsp; <INPUT class="BigButton"
			onClick="location='new.aspx'" type="button" value="重填"></TD>
	</TR>
</TABLE>
<script Language="JavaScript">		
				function status_change()
				{
					if(document.getElementById("rdoStatus0").checked)
						document.getElementById("sltCompletedPercent").selectedIndex=0;
					if(document.getElementById("rdoStatus2").checked)
						document.getElementById("sltCompletedPercent").selectedIndex=10;
				}
				
				function percent_change()
				{
					if(document.getElementById("sltCompletedPercent").value == "0")
					{
						document.getElementById("rdoStatus0").checked = true;
						document.getElementById("rdoStatus1").checked = false;
						document.getElementById("rdoStatus2").checked = false;
					}
					else if(document.getElementById("sltCompletedPercent").value == "10")
					{
						document.getElementById("rdoStatus0").checked = false;
						document.getElementById("rdoStatus1").checked = false;
						document.getElementById("rdoStatus2").checked = true;
					}
					else
					{
						document.getElementById("rdoStatus0").checked = false;
						document.getElementById("rdoStatus1").checked = true;
						document.getElementById("rdoStatus2").checked = false;						
					}
				}		
				</script> <BR>

</div>


<div><input type="hidden" name="__EVENTVALIDATION"
	id="__EVENTVALIDATION" value= /></div>
</form>
</body>
</HTML>
